package edu.sdbi.judge.domain.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;

import java.util.Date;
import java.util.Objects;

@Data
public class Comment {
    @Id
    private String id;
    private Integer type;
    private String relationId;
    private String text;
    private String createUserId;
    private Date createTime;
    private Boolean isDelete;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Comment comment = (Comment) o;
        return Objects.equals(id, comment.id) && Objects.equals(type, comment.type) && Objects.equals(relationId, comment.relationId) && Objects.equals(text, comment.text);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, type, relationId, text);
    }
}
